-
-
Notifications
You must be signed in to change notification settings - Fork 494
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Get backend URL from env #927
base: develop
Are you sure you want to change the base?
Conversation
Signed-off-by: K mehant <[email protected]>
Hey @kmehant, TravisBuddy Request Identifier: d9885a90-d5aa-11ea-8ca9-c37e1b84d109 |
Signed-off-by: K mehant <[email protected]>
Travis tests have failedHey @kmehant, 1st Builddocker build -f ui/Dockerfile.dev -t scoreucsc/bassa-ui:dev ui >/dev/null
TravisBuddy Request Identifier: f0ac3040-d5fd-11ea-8ca9-c37e1b84d109 |
Signed-off-by: K mehant <[email protected]>
Use environment variable |
Hey @kmehant, TravisBuddy Request Identifier: 0bb5a100-d603-11ea-8ca9-c37e1b84d109 |
ui/Dockerfile
Outdated
|
||
# Add environment variable values to env.js | ||
# ENV: apiUrl : backend url | ||
RUN sh env.sh |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This won't work, this will run on the build time not on run time. Users who pull the docker image from the Docker hub won't be able to change the values when running.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@agentmilindu Made a workaround, Please look at it.
Signed-off-by: K mehant <[email protected]>
Hey @kmehant, TravisBuddy Request Identifier: 53767e70-d625-11ea-8693-3322afd57804 |
Try this method. See https://hub.docker.com/_/nginx COPY the |
pattern=' window.__env.apiUrl.*' | ||
replacement=" window.__env.apiUrl = '${apiUrl}';" | ||
|
||
sed -i -e 's,'"$pattern"','"$replacement"',' /usr/share/nginx/html/env.js |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is it not possible to move this to a .json
file and patch that accordingly or change it accordingly? What is the reason for patching a .js
file?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@JaDogg Actually I used the javascript file which is imported in static HTML file so that whenever the homepage is loaded, the JS script is run and the variables are as well loaded.
Signed-off-by: K mehant <[email protected]>
Signed-off-by: K mehant <[email protected]>
Hey @kmehant, TravisBuddy Request Identifier: 9b4213c0-d717-11ea-85fc-4b61cecd2c91 |
Hey @kmehant, TravisBuddy Request Identifier: 2beb4f90-d718-11ea-85fc-4b61cecd2c91 |
@agentmilindu I have tested it now, it works well having But all server routes give out 404 because of this PR #890 which does not seem to work with WSGI and supervisord layers well. Works without WSGI and supervisord though. |
Are you planning to have bassa server also routed through the same nginx 🤔, then how about mounting the nginx config with an another server block for Bassa server? |
Signed-off-by: K mehant [email protected]